﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WeatherNet.yahoo
{
    public class YahooWeatherClient : IWeatherClient
    {
        public async Task<IEnumerable<WeatherResult>> GetWeatherValues(params string[] places)
        {
            var query = new YQLWeatherQuery();
            var results = await query.GetWeatherValues(places);

            return results.Select(r => new WeatherResult(r.location, r.item.condition, r.item.forecast));
        }

    }
}
